-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Viewer: enable pasting json report on app #1128
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs a rebase
const json = JSON.parse(e.clipboardData.getData('text')); | ||
this.replaceReportHTML(json); | ||
} catch (err) { | ||
// noop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe log the failure here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure it will be that useful to users. I'd prefer just ignoring random key pressing or users that accidentally paste something they didn't mean to in our app.
Note: replaceReportHTML
will show a butter bar if the json file is invalid, so there's some feedback already built in if this go wrong.
onPaste(e) { | ||
e.preventDefault(); | ||
|
||
ga('send', 'event', 'report', 'paste'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be logging if it was an unsuccessful (e.g. inadvertent) paste?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
PTAL |
ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :paste:
R: all
So easy!